*********************************************************************************************************************************************************************
* This Stata do-file contains code that generates all tables and figures in main text and appendix of "Racial Concordance in the Market for Financial Advice".	
* There are 8 required data input files (XXX.dta).


	* "time-series.dta" is a 30% random sample of the dataset used in the paper for Figure 1
	* "map.dta" is used in the paper for Figure 2
	* "firm char.dta" is a 30% random sample of the dataset used in the paper for Table 2 & Table A1 Panel B
	* "community char.dta" is a 10% random sample of the dataset used in the paper for Table 3 & Table A1 Panel A
	* "advisor char.dta" is a 10% random sample of the dataset used in the paper for Table 4 & 5
	* "participation and longevity.dta" is a 10% random sample of the dataset used in the paper for Table 6 & 7
	* "community sum stat.dta" is a 10% random sample of the dataset used in the paper for Table A1C & A2
	* "participation and longevity appendix.dta" is a 10% random sample of the dataset used in the paper for Table A3 & A4

* all identifying variables have been masked and identified as masked variables in their labels.
* This program was run without errors in Stata 16.1. 
* The reghdfe command for STATA is currently available at: https://scorreia.com/software/reghdfe/
* The maptile command for STATA is currently available at: https://michaelstepner.com/maptile/
* Authors: Chris Clifford, Will Gerken & Tian Qiu
* Date Modified: 1/24/2023
**********************************************************************************************************************************************************************


* global paths
 	global tableOutput "C:\Users\Dropbox\CliffordGerkenQiu\RCFS replication"
 	global datafolder "C:\Users\Dropbox\CliffordGerkenQiu\RCFS replication"


***************************************************
* Figure 1
***************************************************
use "$datafolder/time-series.dta", clear

tsset year
tsline api_dum black_dum hispanic_dum

***************************************************
* Figure 2
***************************************************
use "$datafolder/map.dta", clear

maptile frac_api, geo(zip5) rangecolor(white red*1) cutv(0 0.1 0.3) legd(1) ndf(white)  spopt(legend(pos(5) label(1 "") label(2 "No API advisor") label(5 "> 0.3")))
maptile api_dum, geo(zip5) rangecolor(white red*1) cutv(0) ndf(white) spopt(legstyle(0) legend(pos(5) size(small) label(1 "") label(2 "No API advisor") label(3 "Have API advisor")))


maptile frac_black, geo(zip5) rangecolor(white blue*1) cutv(0 0.1 0.3) ndf(white) spopt(legend(pos(5) label(1 "") label(2 "No Black advisor") label(5 "> 0.3")))
maptile black_dum, geo(zip5) rangecolor(white blue*1) cutv(0) ndf(white) spopt(legend(pos(5) size(small) label(1 "") label(2 "No Black advisor") label(3 "Have Black advisor")))


maptile frac_hisp, geo(zip5) rangecolor(white green*1) cutv(0 0.1 0.3) ndf(white) spopt(legend(pos(5) size(small) label(1 "") label(2 "No Hispanic advisor") label(5 "> 0.3")))
maptile hispanic_dum, geo(zip5) rangecolor(white green*1) cutv(0) ndf(white) spopt(legend(pos(5) size(small) label(1 "") label(2 "No Hispanic advisor") label(3 "Have Hispanic advisor")))


***************************************************
* Table 1
***************************************************
* Table 1 presents data obtained from https://www.bls.gov/


***************************************************
* Table 2
***************************************************
use "$datafolder/firm char.dta", clear

eststo clear
qui eststo: reg N_state api_dum black_dum hispanic_dum if full_sample, cluster(zip)
estadd local ZFE  "-"
qui eststo: reghdfe N_state api_dum black_dum hispanic_dum if full_sample, a(zip) cluster(zip)
estadd local ZFE  "Yes"

qui eststo: reg ln_N_branch api_dum black_dum hispanic_dum if full_sample, cluster(zip5)
estadd local ZFE  "-"
qui eststo: reghdfe ln_N_branch api_dum black_dum hispanic_dum if full_sample, a(zip) cluster(zip)
estadd local ZFE  "Yes"

qui eststo: reg ln_N_adv api_dum black_dum hispanic_dum if full_sample, cluster(zip)
estadd local ZFE  "-"
qui eststo: reghdfe ln_N_adv api_dum black_dum hispanic_dum if full_sample, a(zip) cluster(zip)
estadd local ZFE  "Yes"

qui eststo: reg ln_aum api_dum black_dum hispanic_dum if aum_sample, cluster(zip)
estadd local ZFE  "-"
qui eststo: reghdfe ln_aum api_dum black_dum hispanic_dum if aum_sample, a(zip) cluster(zip)
estadd local ZFE  "Yes"

esttab * using "$tableOutput/table2", replace label stats(ZFE clustvar r2 N, fmt(0 0 3 %9.0fc) ///
	labels("Zip FE" "Cluster" "\(R^{2}\)" "Observations"))	///
	substitute(zip5 "Zip") ///
	b(3) se(3) varwidth(40) booktabs nonotes ///
	keep(api_dum black_dum hispanic_dum _cons) coeflabel(api_dum "API Advisor" black_dum "Black Advisor" hispanic_dum "Hispanic Advisor" _cons "Constant") ///
	star(* 0.10 ** 0.05 *** 0.01) nomtitles mgroups("\# of States" "ln(\# of Branches)" "ln(\# of ADV)" "ln(AUM)", pattern(1 0 1 0 1 0 1 0) span prefix(\multicolumn{@span}{c}{)suffix(}))
	

	
***************************************************
* Table 3
***************************************************
use "$datafolder/community char.dta", clear

* Panel A
eststo clear

** API
qui eststo: reg frac_api api_dum black_dum hispanic_dum, cluster(zip)
estadd local FFE  "-"
qui eststo: reghdfe frac_api api_dum black_dum hispanic_dum, a(pseudo_fcrdn) cluster(zip)
estadd local FFE  "Yes"

** Black
qui eststo: reg frac_black api_dum black_dum hispanic_dum, cluster(zip)
estadd local FFE  "-"
qui eststo: reghdfe frac_black api_dum black_dum hispanic_dum, a(pseudo_fcrdn) cluster(zip)
estadd local FFE  "Yes"
	
** Hispanic
qui eststo: reg frac_hispanic api_dum black_dum hispanic_dum, cluster(zip)
estadd local FFE  "-"
qui eststo: reghdfe frac_hispanic api_dum black_dum hispanic_dum, a(pseudo_fcrdn) cluster(zip)
estadd local FFE  "Yes"
	
esttab * using "$tableOutput/table3A", replace label stats(FFE clustvar r2 N, fmt(0 0 3 %9.0fc) ///
	labels("Firm FE" "Cluster" "\(R^{2}\)" "Observations"))	///
	substitute(zip "Zip") ///
	b(3) se(3) varwidth(40) booktabs nonotes ///
	keep(api_dum black_dum hispanic_dum _cons) order(api_dum black_dum hispanic_dum _cons) coeflabel(api_dum "API Advisor" black_dum "Black Advisor" hispanic_dum "Hispanic Advisor" _cons "Constant") ///
	star(* 0.10 ** 0.05 *** 0.01) nomtitles mgroups("Frac. API" "Frac. Black" "Frac. Hispanic", pattern(1 0 1 0 1 0 1 0) span prefix(\multicolumn{@span}{c}{)suffix(}))

* Panel B
eststo clear

** (Un)employment and race
qui eststo: reg unemp api_dum black_dum hispanic_dum, cluster(zip)
estadd local FFE  "-"
qui eststo: reghdfe unemp api_dum black_dum hispanic_dum, a(pseudo_fcrdn) cluster(zip)
estadd local FFE  "Yes"

** Income and race
qui eststo: reg ln_income api_dum black_dum hispanic_dum, cluster(zip)
estadd local FFE  "-"
qui eststo: reghdfe ln_income api_dum black_dum hispanic_dum, a(pseudo_fcrdn) cluster(zip)
estadd local FFE  "Yes"

** Education and race
qui eststo: reg bachelor api_dum black_dum hispanic_dum, cluster(zip)
estadd local FFE  "-"
qui eststo: reghdfe bachelor api_dum black_dum hispanic_dum, a(pseudo_fcrdn) cluster(zip)
estadd local FFE  "Yes"

esttab * using "$tableOutput/table3B", replace label stats(FFE clustvar r2 N, fmt(0 0 3 %9.0fc) ///
	labels("Firm FE" "Cluster" "\(R^{2}\)" "Observations"))	///
	substitute(zip "Zip") ///
	b(3) se(3) varwidth(40) booktabs nonotes ///
	keep(api_dum black_dum hispanic_dum _cons) coeflabel(api_dum "API Advisor" black_dum "Black Advisor" hispanic_dum "Hispanic Advisor" _cons "Constant") ///
	star(* 0.10 ** 0.05 *** 0.01) nomtitles mgroups("Unemployment" "ln(Income)" "Frac. College", pattern(1 0 1 0 1 0) span prefix(\multicolumn{@span}{c}{)suffix(}))

	
	
***************************************************
* Table 4
***************************************************	
use "$tar\RCFS replication\advisor char.dta", clear

eststo clear

local varlist "experience n_firm stot s6 s24_26 s65_66 past_ac"
foreach var in `varlist'{
qui eststo: reg `var' api_dum black_dum hispanic_dum, cluster(zip)
estadd local FFE  "-"
estadd local ZFE  "-"

qui eststo: reghdfe `var' api_dum black_dum hispanic_dum, a(pseudo_fcrdn) cluster(zip)
estadd local FFE  "Yes"
estadd local ZFE  "-"

qui eststo: reghdfe `var' api_dum black_dum hispanic_dum, a(zip) cluster(zip)
estadd local FFE  "-"
estadd local ZFE  "Yes"
}

esttab * using "$tableOutput/table4", replace label stats(FFE ZFE clustvar r2 N, fmt(0 0 0 3 %9.0fc) ///
	labels("Firm FE" "Zip FE" "Cluster" "\(R^{2}\)" "Observations"))	///
	substitute(zip "Zip") ///
	b(3) se(3) varwidth(40) booktabs nonotes ///
	keep(api_dum black_dum hispanic_dum _cons) coeflabel(api_dum "API Advisor" black_dum "Black Advisor" hispanic_dum "Hispanic Advisor" _cons "Constant") ///
	star(* 0.10 ** 0.05 *** 0.01) nomtitles mgroups("Years of Exp." "\# of Firms" "\# of Licenses" "Insurance" "Principal" "Inv. Advisor" "Misconduct", pattern(1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0) span prefix(\multicolumn{@span}{c}{)suffix(}))
	


***************************************************
* Table 5
***************************************************

use "$tar\RCFS replication\advisor char.dta", clear

eststo clear

local varlist "experience n_firm stot s6 s24_26 s65_66 past_ac"
foreach var in `varlist'{
qui eststo: reg `var' match 1.api_dum##c.frac_api 1.black_dum##c.frac_black 1.hispanic_dum##c.frac_hispanic, cluster(zip)
estadd local FFE  "-"

qui eststo: reghdfe `var' match 1.api_dum##c.frac_api 1.black_dum##c.frac_black 1.hispanic_dum##c.frac_hispanic, a(pseudo_fcrdn) cluster(zip)
estadd local FFE  "Yes"
}

esttab * using "$tableOutput/table5", replace label stats(FFE clustvar r2 N, fmt(0 0 3 %9.0fc) ///
	labels("Firm FE" "Cluster" "\(R^{2}\)" "Observations"))	///
	substitute(zip "Zip" =1 "" (.) "") ///
	b(3) se(3) varwidth(40) booktabs nonotes ///
	star(* 0.10 ** 0.05 *** 0.01) nomtitles drop(_cons) mgroups("Years of Exp." "\# of Firms" "\# of Licenses" "Insurance" "Principal" "Inv. Advisor" "Misconduct", pattern(1 0 1 0 1 0 1 0 1 0 1 0 1 0) span prefix(\multicolumn{@span}{c}{)suffix(}))
	
***************************************************
* Table 6
***************************************************
use "$datafolder/participation and longevity.dta", clear

global community_race "frac_api frac_black frac_hispanic"
global community_control " ln_income bachelor unemployment " 
 
global advisor_race " api_dum black_dum hispanic_dum "
global advisor_control "experience s6 s7 ia supervisor past_ems"

eststo clear
 
qui eststo:  reg participation $community_race if sample==1, cluster(zip)
 	estadd local YearFE "-" 
	estadd local advcontrol "-" 
	estadd local ZipFE "-"
	
qui eststo:  reghdfe participation $community_race $community_control if sample==1, a(year) nocons cluster(zip)
 	estadd local YearFE "Yes"  
	estadd local advcontrol "-" 
	estadd local ZipFE "-"
	
qui eststo:  reghdfe participation $community_race $community_control adv_pop $advisor_race $advisor_control if sample==1, a(year) nocons cluster(zip)
 	estadd local YearFE "Yes"
 	estadd local advcontrol "Yes" 
	estadd local ZipFE "-"
	
qui eststo:  reghdfe participation $community_race $community_control adv_pop $advisor_race $advisor_control match if sample==1, a(year) nocons cluster(zip)
 	estadd local YearFE "Yes"   	
 	estadd local advcontrol "Yes"  	
	estadd local ZipFE "-"
	
qui eststo:  reghdfe participation $community_race $community_control adv_pop $advisor_race $advisor_control match interact_1_api interact_1_black interact_1_hispanic if sample==1, a(year) nocons cluster(zip)
 	estadd local YearFE "Yes"  
 	estadd local advcontrol "Yes" 
	estadd local ZipFE "-"
	
qui eststo:  reghdfe participation $community_race $community_control adv_pop $advisor_race $advisor_control match interact_1_api interact_1_black interact_1_hispanic  if sample==1, a(year zip) nocons cluster(zip)
 	estadd local YearFE "Yes"  
 	estadd local ZipFE "Yes"
 	estadd local advcontrol "Yes" 
 	
global tablename table6
esttab using "$tableOutput/$tablename", replace label stats(  YearFE advcontrol ZipFE  r2 N, fmt(0 0 0 3 %13.0fc) labels( "Year FE"  "Advisor Controls" "Zip FE" "\(R^{2}\)" "Observations")) b(4) se(4) varwidth(40) order($community_race $community_control  adv_pop $advisor_race $advisor_control   match interact_1_api interact_1_black interact_1_hispanic _cons)  keep($community_race $community_control adv_pop $advisor_race match interact_1_api interact_1_black interact_1_hispanic _cons) booktabs nonotes nomtitles star(* 0.10 ** 0.05 *** 0.01)   substitute(\_ _)



***************************************************
* Table 7
***************************************************
use "$datafolder/participation and longevity.dta", clear

global community_race "frac_api frac_black frac_hispanic"
global community_control " ln_income bachelor unemployment " 
 
global advisor_race " api_dum black_dum hispanic_dum "
global advisor_control "experience s6 s7 ia supervisor past_ems"

eststo clear
  
qui eststo: reg quit $advisor_race if sample==1, cluster(zip)
  	estadd local YearFE "-" 
  	estadd local ZipFE "-"
   	estadd local commcontrol "-" 
   	estadd local advcontrol "-" 	
	
qui eststo: reghdfe quit $advisor_race $advisor_control if sample==1, a(year) nocons cluster(zip)
  	estadd local YearFE "Yes"  
   	estadd local advcontrol "Yes" 
	estadd local ZipFE "-"
   	estadd local commcontrol "-" 
	
qui eststo: reghdfe quit $community_race $community_control  $advisor_race $advisor_control if sample==1, a(year) nocons cluster(zip)
  	estadd local YearFE "Yes"  
  	estadd local commcontrol "Yes"
  	estadd local advcontrol "Yes"
	estadd local ZipFE "-"
	
qui eststo: reghdfe quit $community_race $community_control  $advisor_race $advisor_control match if sample==1, a(year) nocons cluster(zip)
  	estadd local YearFE "Yes"  
  	estadd local commcontrol "Yes"
  	estadd local advcontrol "Yes" 
	estadd local ZipFE "-"
	
qui eststo: reghdfe quit $community_race $community_control  $advisor_race $advisor_control match interact_1_api interact_1_black interact_1_hispanic if sample==1, a(year) nocons cluster(zip)
  	estadd local YearFE "Yes"  
  	estadd local commcontrol "Yes" 
   	estadd local advcontrol "Yes"
	estadd local ZipFE "-"
	
qui eststo: reghdfe quit $community_race $community_control  $advisor_race $advisor_control match interact_1_api interact_1_black interact_1_hispanic  if sample==1, a(year zip) nocons cluster(zip)
  	estadd local YearFE "Yes"  
  	estadd local ZipFE "Yes"
   	estadd local commcontrol "Yes" 
   	estadd local advcontrol "Yes" 	
	
global tablename table7

esttab using "$tableOutput/$tablename", replace label stats(  YearFE advcontrol commcontrol ZipFE  r2 N, fmt(0 0 0 0 3 %13.0fc) labels( "Year FE" "Advisor Controls" "Community Controls" "Zip FE" "\(R^{2}\)" "Observations")) b(4) se(4) varwidth(40) order( $advisor_race $advisor_control $community_race $community_control match interact_1_api interact_1_black interact_1_hispanic _cons)  keep($community_race $advisor_race match interact_1_api interact_1_black interact_1_hispanic _cons) booktabs nonotes nomtitles star(* 0.10 ** 0.05 *** 0.01)   substitute(\_ _)


***************************************************
* Table A1 Panel A
***************************************************
use "$datafolder/advisor char.dta", clear

eststo clear
estpost tabstat experience stot s6 s24_26 s65_66 past_ac, statistics(n mean sd p25 p50 p75) columns(statistics)
esttab using "$tableOutput/tableA1A", replace label wide booktabs ///
cells("mean(f(2)) sd(f(2)) p25(f(2)) p50(f(2)) p75(f(2))") collabels("Mean" "SD" "25\%" "50\%" "75\%") ///
nonumber nomtitle noobs nonote


***************************************************
* Table A1 Panel B
***************************************************
use "$datafolder/firm char.dta", clear
keep if full_sample
gduplicates drop pseudo_fcrdn, force

eststo clear
estpost tabstat N_state N_branch N_advisor n_minor frac_api_adv frac_black_adv frac_hispanic_adv, statistics(n mean sd p25 p50 p75) columns(statistics)
esttab using "$tableOutput/tableA1B", replace label wide booktabs ///
cells("mean(f(2)) sd(f(2)) p25(f(2)) p50(f(2)) p75(f(2))") collabels("Mean" "SD" "25\%" "50\%" "75\%") ///
nonumber nomtitle noobs nonote


***************************************************
* Table A1 Panel C & A2
***************************************************
use "$datafolder/community sum stat.dta", clear

eststo clear
estpost tabstat bachelor unemployment median_household_income participation frac_white frac_api frac_black frac_hispanic if year == 2019, statistics(n mean sd p25 p50 p75) columns(statistics)
esttab using "$tableOutput/tableA1C", replace label wide booktabs ///
cells("mean(f(2)) sd(f(2)) p25(f(2)) p50(f(2)) p75(f(2))") collabels("Mean" "SD" "25\%" "50\%" "75\%") ///
nonumber nomtitle noobs nonote



** Separate by have advisor status
eststo clear
estpost tabstat bachelor unemployment median_household_income participation frac_white frac_api frac_black frac_hispanic if year == 2019 & n_adv != 0, statistics(n mean sd p25 p50 p75) columns(statistics)
esttab using "$tableOutput/tableA2A", replace label wide booktabs ///
cells("mean(f(2)) sd(f(2)) p25(f(2)) p50(f(2)) p75(f(2))") collabels("Mean" "SD" "25\%" "50\%" "75\%") ///
nonumber nomtitle noobs nonote

eststo clear
estpost tabstat bachelor unemployment median_household_income participation frac_white frac_api frac_black frac_hispanic if year == 2019 & n_adv == 0, statistics(n mean sd p25 p50 p75) columns(statistics)
esttab using "$tableOutput/tableA2B", replace label wide booktabs ///
cells("mean(f(2)) sd(f(2)) p25(f(2)) p50(f(2)) p75(f(2))") collabels("Mean" "SD" "25\%" "50\%" "75\%") ///
nonumber nomtitle noobs nonote




***************************************************
* Table A3
***************************************************
use "$datafolder/participation and longevity appendix.dta", clear

global community_race "frac_api frac_black frac_hispanic"
global community_control " ln_income bachelor unemployment " 
 
global advisor_race " api_dum black_dum hispanic_dum "
global advisor_control "experience s6 s7 ia supervisor past_ems"

eststo clear
 
qui eststo:  reg participation $community_race if sample==1, cluster(zip)
 	estadd local YearFE "-" 
	estadd local advcontrol "-" 
	estadd local ZipFE "-"
	
qui eststo:  reghdfe participation $community_race $community_control if sample==1, a(year) nocons cluster(zip)
 	estadd local YearFE "Yes"  
	estadd local advcontrol "-" 
	estadd local ZipFE "-"
	
qui eststo:  reghdfe participation $community_race $community_control adv_pop $advisor_race $advisor_control if sample==1, a(year) nocons cluster(zip)
 	estadd local YearFE "Yes"
 	estadd local advcontrol "Yes" 
	estadd local ZipFE "-"
	
qui eststo:  reghdfe participation $community_race $community_control adv_pop $advisor_race $advisor_control match if sample==1, a(year) nocons cluster(zip)
 	estadd local YearFE "Yes"   	
 	estadd local advcontrol "Yes"  	
	estadd local ZipFE "-"
	
qui eststo:  reghdfe participation $community_race $community_control adv_pop $advisor_race $advisor_control match interact_1_api interact_1_black interact_1_hispanic if sample==1, a(year) nocons cluster(zip)
 	estadd local YearFE "Yes"  
 	estadd local advcontrol "Yes" 
	estadd local ZipFE "-"
	
qui eststo:  reghdfe participation $community_race $community_control adv_pop $advisor_race $advisor_control match interact_1_api interact_1_black interact_1_hispanic  if sample==1, a(year zip) nocons cluster(zip)
 	estadd local YearFE "Yes"  
 	estadd local ZipFE "Yes"
 	estadd local advcontrol "Yes" 
 	
global tablename tableA3
esttab using "$tableOutput/$tablename", replace label stats(  YearFE advcontrol ZipFE  r2 N, fmt(0 0 0 3 %13.0fc) labels( "Year FE"  "Advisor Controls" "Zip FE" "\(R^{2}\)" "Observations")) b(4) se(4) varwidth(40) order($community_race $community_control  adv_pop $advisor_race $advisor_control   match interact_1_api interact_1_black interact_1_hispanic _cons)  keep($community_race $community_control adv_pop $advisor_race match interact_1_api interact_1_black interact_1_hispanic _cons) booktabs nonotes nomtitles star(* 0.10 ** 0.05 *** 0.01)   substitute(\_ _)



***************************************************
* Table A4
***************************************************
use "$datafolder/participation and longevity appendix.dta", clear

global community_race "frac_api frac_black frac_hispanic"
global community_control " ln_income bachelor unemployment " 
 
global advisor_race " api_dum black_dum hispanic_dum "
global advisor_control "experience s6 s7 ia supervisor past_ems"

eststo clear
  
qui eststo: reg quit $advisor_race if sample==1, cluster(zip)
  	estadd local YearFE "-" 
  	estadd local ZipFE "-"
   	estadd local commcontrol "-" 
   	estadd local advcontrol "-" 	
	
qui eststo: reghdfe quit $advisor_race $advisor_control if sample==1, a(year) nocons cluster(zip)
  	estadd local YearFE "Yes"  
   	estadd local advcontrol "Yes" 
	estadd local ZipFE "-"
   	estadd local commcontrol "-" 
	
qui eststo: reghdfe quit $community_race $community_control  $advisor_race $advisor_control if sample==1, a(year) nocons cluster(zip)
  	estadd local YearFE "Yes"  
  	estadd local commcontrol "Yes"
  	estadd local advcontrol "Yes"
	estadd local ZipFE "-"
	
qui eststo: reghdfe quit $community_race $community_control  $advisor_race $advisor_control match if sample==1, a(year) nocons cluster(zip)
  	estadd local YearFE "Yes"  
  	estadd local commcontrol "Yes"
  	estadd local advcontrol "Yes" 
	estadd local ZipFE "-"
	
qui eststo: reghdfe quit $community_race $community_control  $advisor_race $advisor_control match interact_1_api interact_1_black interact_1_hispanic if sample==1, a(year) nocons cluster(zip)
  	estadd local YearFE "Yes"  
  	estadd local commcontrol "Yes" 
   	estadd local advcontrol "Yes"
	estadd local ZipFE "-"
	
qui eststo: reghdfe quit $community_race $community_control  $advisor_race $advisor_control match interact_1_api interact_1_black interact_1_hispanic if sample==1, a(year zip) nocons cluster(zip)
  	estadd local YearFE "Yes"  
  	estadd local ZipFE "Yes"
   	estadd local commcontrol "Yes" 
   	estadd local advcontrol "Yes" 	
	
global tablename tableA4

esttab using "$tableOutput/$tablename", replace label stats(  YearFE advcontrol commcontrol ZipFE  r2 N, fmt(0 0 0 0 3 %13.0fc) labels( "Year FE" "Advisor Controls" "Community Controls" "Zip FE" "\(R^{2}\)" "Observations")) b(4) se(4) varwidth(40) order( $advisor_race $advisor_control $community_race $community_control match interact_1_api interact_1_black interact_1_hispanic _cons)  keep($community_race $advisor_race match interact_1_api interact_1_black interact_1_hispanic _cons) booktabs nonotes nomtitles star(* 0.10 ** 0.05 *** 0.01)   substitute(\_ _)


